package cn.controller;

import cn.pojo.HealthVaccine;
import cn.service.HealthVaccineService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

@RestController
@CrossOrigin
@RequestMapping(value = "/vaccine")
public class HealthVaccineController {
    @Autowired
    private HealthVaccineService vaccineService;

    @GetMapping("/select")
    public Map<String, Object> selectVaccine(HealthVaccine vaccine) {
        System.out.println(vaccine);
        return vaccineService.selectVaccine(vaccine);
    }

    @PostMapping("/update")
    public Map<String, Object> updateVaccine(HealthVaccine vaccine){
        return vaccineService.updateVaccine(vaccine);
    }


    @PostMapping("/save")
    public Map<String, Object> saveVaccine(HealthVaccine vaccine) {
        return vaccineService.saveVaccine(vaccine);
    }
}
